{% extends 'default/layout.html' -%}
{%- block doctype %}
<!DOCTYPE html>
{% endblock -%}

{% block extrahead %}
<link href="{{ pathto('_static/favicon.ico', 1) }}" type="image/x-icon" rel="icon" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

{% for lang in languages %}
	{%- if lang != language -%}
		{%- if has_lang(lang, pagename) -%}
		<link rel="alternate" hreflang="{{ lang }}" href="{{ lang_link(lang, pagename) }}" />
		{%- endif -%}
	{%- endif -%}
{% endfor %}

<link rel="search" type="application/opensearchdescription+xml" title="CakePHP Book 2.x Search" href="{{ pathto('_static/opensearchdescription-book-2-x.xml', 1) }}">
<script type="text/javascript">
window.lang = "{{ language }}";
</script>
{% endblock %}

{%- set script_files = script_files + ["_static/app.js", "_static/modernizr.foundation.js", "_static/foundation.js"] -%}

{# Use the header block to insert the CSF navbar #}
{%- block header %}
{# Outer wrapper for pushing the footer to the bottom #}
<div id="container">

<div id="cakephp-global-navigation">
	<ul>
		<li class="main"><a href="http://cakephp.org">CakePHP</a></li>
		<li class="primary"><a href="#" class="empty">Downloads</a>
			<ul class="second-level">
				<li><a href="https://github.com/cakephp/cakephp/tags">Releases</a></li>
				<li><a href="http://pear.cakephp.org">Pear channel</a></li>
			</ul>
		</li>
		<li class="primary"><a href="#" class="empty">Documentation</a>
			<ul class="second-level">
				<li><a href="http://api.cakephp.org">API</a></li>
				<li><a href="http://book.cakephp.org">Book</a></li>
			</ul>
		</li>
		<li class="primary"><a href="http://community.cakephp.org">Community</a>
			<ul class="second-level">
				<li><a href="http://webchat.freenode.net/?channels=cakephp&uio=MT1mYWxzZSY5PXRydWUmMTE9MjQ2b8">Help &amp; Support</a></li>
				<li><a href="https://github.com/cakephp/cakephp/issues">Issues</a></li>
				<li><a href="http://bakery.cakephp.org">The Bakery</a></li>
				<li><a href="http://stackoverflow.com/tags/cakephp">Stack Overflow</a></li>
				<li><a href="http://www.facebook.com/groups/cake.community">Facebook Group</a></li>
				<li><a href="http://goo.gl/mSC0s">Google+ Community</a></li>
				<li><a href="http://www.youtube.com/user/CakePHP">YouTube Channel</a></li>
				<li><a href="http://podcast.cakephp.org">CakePHP Podcast</a></li>
				<li><a href="http://twitter.com/CakePHP">Follow us on Twitter</a></li>
				<li><a href="http://groups.google.com/group/cake-php">Google Group</a></li>
				<li><a href="http://github.com/cakephp/cakephp/contributors">Contributors</a></li>
				<li><a href="http://plugins.cakephp.org">Plugins &amp; Packages</a></li>
				<li><a href="http://community.cakephp.org/get-involved">Get Involved</a></li>
				<li><a href="http://community.cakephp.org/guidelines">Guidelines</a></li>
				<li><a href="http://cakefest.org">CakeFest</a></li>
				<li><a href="http://cakephp.org/logos">Logo</a></li>
			</ul>
		</li>
		<li class="primary"><a href="http://cakephp.org/services">Services</a>
			<ul class="second-level">
				<li><a href="http://certification.cakephp.org">Certification</a></li>
				<li><a href="http://cakephp.org/services/consultation">Consultation</a></li>
				<li><a href="http://cakephp.org/services/support">Support</a></li>
				<li><a href="http://training.cakephp.org">Training</a></li>
			</ul>
		</li>
	</ul>
</div>
{% endblock -%}


{%- block relbar1 %}
<div class="masthead">
	<div class="header-backing"></div>
	<div class="searchbar row">
		<div class="columns three phone-one">
			<a class="logo" href="{{ pathto(master_doc) }}">
			<img src="{{ pathto('_static/cake-logo.png', 1) }}" alt="CakePHP" width="70" />
			</a>
		</div>
		{% include 'searchbox.html' %}
	</div>
</div>
<div class="breadcrumb-header">
	<div class="related row">
		<div class="columns three root-link">
			<a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
		</div>
		<div class="columns nine">
			<ul class="inline breadcrumb">
			{%- for parent in parents %}
			<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
				<a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %} itemprop="url"><span itemprop="title">{{ parent.title }}</span></a>
			</li>
			{%- endfor %}
			</ul>
			<div class="versions dropdown">
				<a href="#">2.x Book</a>
				<ul>
					<li><a href="http://book.cakephp.org/3.0/en">3.0 Book</a></li>
					<li><a href="http://book.cakephp.org/1.3/{{ language }}/">1.3 Book</a></li>
					<li><a href="http://book.cakephp.org/1.2/{{ language }}/">1.2 Book</a></li>
					<li><a href="http://book.cakephp.org/1.1/en">1.1 Book</a></li>
				</ul>
			</div>

			<div class="languages dropdown">
				{% for lang in languages %}
					{%- if lang == language -%}
						<a href="#">{{ lang }}</a>
					{%- endif -%}
				{% endfor %}

				<ul>
				{% for lang in languages %}
					<li>
						{%- if lang == language -%}
						{# Do nothing, we print the active one above #}
						{%- elif has_lang(lang, pagename) -%}
						<a href="{{ lang_link(lang, pagename) }}">{{ lang }}</a>
						{%- else -%}
						<span class="disabled">{{ lang }}</span>
						{%- endif -%}
					</li>
				{% endfor %}
				</ul>
			</div>
		</div>
	</div>
</div>
{% endblock -%}


{%- block content %}
<div class="content row">
	<div class="document columns nine push-three">
		<div class="body">
			{%- if pagename != 'search' -%}
				<a class="button pale improve" href="https://github.com/cakephp/docs/edit/{{ branch }}/{{ lang_dir(language) }}/{{ pagename }}.rst" target="_blank">Improve this Doc</a>
			{%- endif -%}
			{% block body %} {% endblock %}
		</div>
	</div>

	<div class="sidebar columns three pull-nine">
		{%- for sidebartemplate in sidebars %}
		{%- include sidebartemplate %}
		{%- endfor %}
	</div>

</div>

<div class="content row">
	<ul class="related-pages inline">
	{%- for rellink in rellinks %}
	<li>
		<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>
			{{- rellink[3] -}}
		</a>
	</li>
	{%- endfor %}
	</ul>
</div>

	<div class="footer-push"> </div>
</div>
{# End of div[id=wrapper] #}
{% endblock -%}

{%- block relbar2 %}
{# Empty so links aren't duplicated #}
{% endblock %}

{%- block footer %}
{# Push the footer down to the bottom of the page #}

<div class="footer">
	<div class="row">
		<div class="columns six offset-by-three contribute">
			<strong>发现翻译错误?</strong>
			请在下面留言<br />
			<a href="https://github.com/blackpuppy/docs/wiki" target="_blank">[ 我要加入翻译 ]</a>
		</div>
	</div>
	
	<div class="row">
		<div class="columns nine offset-by-three copyright">
			{%- if show_copyright %}
				{%- if hasdoc('copyright') %}
					{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
				{%- else %}
					{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
				{%- endif %}
			{%- endif %}
			{%- if last_updated %}
				{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
			{%- endif %}
			{%- if show_sphinx %}
				{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
			{%- endif %}
		</div>
	</div>
</div>

<div id="nav-modal" class="reveal-modal"> </div>
<div id="inline-search-results"></div>
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F201cbc61deaf9f7ffb521fb23e83db40' type='text/javascript'%3E%3C/script%3E"));
</script>

<!-- Duoshuo Comment BEGIN -->
	<div class="ds-thread"></div>
<script type="text/javascript">
var duoshuoQuery = {short_name:"cakephpchina"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = 'http://static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0]
		|| document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
<!-- Duoshuo Comment END -->

<!-- Grunt Live Reload -->
<script src="http://192.168.56.113:35729/livereload.js"></script>
{%- endblock %}

